﻿using System.Xml.Serialization;

namespace Eugenhome.Atrium.Site
{
    /// <summary>
    /// 
    /// </summary>
    public class ImageItem
    {
        /// <summary></summary>
        [XmlIgnore]
        internal ImageItemCollection _parentCollection;

        /// <summary></summary>
        [XmlAttribute(AttributeName = "id")]
        public int ID { get; set; }

        /// <summary></summary>
        [XmlAttribute(AttributeName = "day")]
        public string Day { get; set; }

        /// <summary></summary>
        [XmlAttribute(AttributeName = "imagehref")]
        public string ImageHref { get; set; }

        /// <summary></summary>
        [XmlAttribute(AttributeName = "deschref")]
        public string DescHref { get; set; }

        /// <summary></summary>
        [XmlText()]
        public string Desc { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public void Update()
        {
            _parentCollection.Save();
            _parentCollection.Load();
        }

        /// <summary>
        /// 
        /// </summary>
        public void Delete()
        {
            _parentCollection.Delete(this);
        }
    }
}
